package com.qf.week1.day05;

import java.util.Random;

public class Cat {
    String name;
    int age;
    String sex;
    String color;
    String variety;
    int  happy;
    int  weight;
    int[] array;
    public Cat(int[] array){

    }



    public Cat(String name, int age, String sex, String color, String variety, int happy, int weight) {
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.color = color;
        this.variety = variety;
        this.happy = happy;
        this.weight = weight;
    }

    public Cat(String name){

    }


    public  void bubbleSort(int[] array) {
        int n = array.length;
        for (int i = 0; i < n - 1; i++) {
            for (int j = 0; j < n - i - 1; j++) {
                if (array[j] > array[j + 1]) {
                    // Swap array[j] and array[j+1]
                    int temp = array[j];
                    array[j] = array[j + 1];
                    array[j + 1] = temp;
                }
            }
        }
    }
    public void eat(){
        Random random = new Random();
        int time = 1+random.nextInt(60);
        int fish = 1+random.nextInt(5);
        int pretty = 1 +random.nextInt(10);
        System.out.print(name+"吃了"+time+"条鱼"+",");
        this.weight = this.weight + fish;
        happy = happy +pretty;
        System.out.println("体重为:"+this.weight+",心情为"+happy);
    }


}

